﻿<html xmlns="http://www.w3.org/1999/html">
<head>
<title>登陆界面</title>
	<script type="application/javascript" src="/webjars/jquery/3.4.1/jquery.min.js"></script>
	<script src="webjars/jquery/3.4.1/jquery.js"></script>
	<script type="text/javascript">
		$(function(){
			$("form").submit(function(){
				//ajax登录请求
				$.ajax({
					url:"checklogin",
					type:'POST',
					data:$("form").serialize(),
					success:function(data){
						alert(data.message);
						if(data.success){
							window.location.href="/first";
						}else{
							alert("用户名或密码错误");
							return "/login";
						}
					}
				})
				return false;
			})
		});

	</script>
	<style type="text/css">
	body {
		background-image: url(/images/bg.jpg);
		background-size:100% 100%;
		background-attachment: fixed;
		background-repeat: no-repeat;
	}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<h2>登录页面</h2>
<form name="form1" method="post">
	<div style="width: 521px; height: 315px; top: 96px; left: 47px; margin: 0px auto;">
		<table width="100%" border="0" cellspacing="0" align="center"
			   cellpadding="4" background="">
			<tr>
				<td width="30%" align="right"><font size="2" color="#FFFFFF"><b>登录名称：</b></font></td>
				<td><input id="id" name="id" type="text" size="30" maxlength="30" /></td>
			</tr>
			<tr>
				<td height="30" align="right"><font size="2" color="#FFFFFF"><b>登录密码：</b></font></td>
				<td><input id="name" name="name" type="text" size="30" maxlength="30" /></td>
			</tr>

			<tr>
				<td colspan="2" height="30" align="center">
					<input type="submit" value="登录"> &nbsp;
					<input type="reset" value="重置" /></td>
		</table>
	</div>
</form>
</body>
</html>
